import 'package:flutter/material.dart';
import 'package:flutter_swiper_null_safety/flutter_swiper_null_safety.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:xinxuan/utils/color_util.dart';

class GoodsSwiperCustomPagination extends SwiperPlugin {

  final int length;

  GoodsSwiperCustomPagination({required this.length});

  @override
  Widget build(BuildContext context, SwiperPluginConfig config) {
    return Container(
      margin: EdgeInsets.only(bottom: 12.h, right: 10.w),
      alignment: Alignment.bottomRight,
      child: Container(
        padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 2.h),
        decoration: BoxDecoration(
          color: bgTipsColor,
          borderRadius: BorderRadius.circular(10.w)
        ),
        child: Text(
          '${config.activeIndex + 1} / $length',
          style: TextStyle(
            color: textWhiteColor,
            fontSize: 12.sp
          ),
        ),
      ),
    );
  }

}